﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FisheryPlatform.Entity;

namespace FisheryPlatform.Search.Entity
{
    public static class ProductIndexEntityExtension
    {
        /// <summary>
        /// 根据产品实体返回产品索引信息
        /// </summary>
        /// <param name="source"></param>
        /// <param name="productInfo"></param>
        /// <returns></returns>
        public static ProductIndexEntity Get(this ProductIndexEntity source, ProductEntity productInfo)
        {
            #region
            return new ProductIndexEntity
                      {
                          ProductId = productInfo.ProductId,
                          CategoryId = productInfo.CategoryId,
                          AreaId = productInfo.AreaId,
                          UserId = productInfo.UserId,
                          MinPrice = productInfo.MinPrice,
                          MaxPrice = productInfo.MaxPrice,
                          Type = productInfo.Type,
                          Title = productInfo.Title,
                          Description = productInfo.Description,
                          UpdateDate = productInfo.UpdateDate,
                          CreateDate = productInfo.CreateDate
                      };
            #endregion
        }
    }
}
